package cn.nai.DemoRan.demo01;

import java.util.*;
import java.util.stream.IntStream;

public class AverageScore{
    private int class_num = 3;
    private int k_num = 4;
    public static void main(String[] args) {
        AverageScore a = new AverageScore();
        int[][] score=new int[a.class_num][a.k_num];
        int[] k_sum=new int[3];
        System.out.println("请输入一班的4个人的成绩：");
        Scanner s=new Scanner(System.in);
        int bound = score[0].length;
        for (int i1 = 0; i1 < bound; i1++) {
            score[0][i1] = s.nextInt();
        }
        System.out.println("请输入二班的4个人的成绩：");
        int bound1 = score[1].length;
        for (int i1 = 0; i1 < bound1; i1++) {
            score[1][i1] = s.nextInt();
        }
        System.out.println("请输入三班的4个人的成绩：");
        int bound2 = score[2].length;
        for (int i1 = 0; i1 < bound2; i1++) {
            score[2][i1] = s.nextInt();
        }
        for(int i = 0; i < score.length; i++) {
            int su=0;
            for(int j = score[i].length - 1; j >= 0; j--) {
                su+=score[i][j];
            }
            k_sum[i]=su;
        }
        System.out.println("一班平均分："+k_sum[0]/4);
        System.out.println("二班平均分："+k_sum[1]/4);
        System.out.println("三班平均分："+k_sum[2]/4);
    }
}

